<%@ page contentType="application/json; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="pe.gob.pnp.despachadores.*" %>
<%@ page import="pe.gob.pnp.actions.*" %>
<%@ page import="java.util.*"%>
<%
    String expediente = request.getParameter("expediente");
    List<LiquidacionBean> listaliquidacion = LiquidacionDespachador.obtenerLiquidacionPersona(Integer.parseInt(expediente));
    pageContext.setAttribute("liquidacion", listaliquidacion);
%>
<c:set var="i" value="0"></c:set>
{
		tablaLiquidacion:
		[
        <c:forEach var="liquidacion" items="${liquidacion}">
               <%
                LiquidacionBean obj= (LiquidacionBean) pageContext.getAttribute("liquidacion");
                String obs  = obj.getCliqu_observaciones()!=null?obj.getCliqu_observaciones():"";
		//obs = obs.replaceAll("\"","'").replaceAll("\'","\\\'").replaceAll("\r\n","\\\\n");
		obs = obs.replace( new Character('\n'),new Character(' ') ).replace( new Character('\r'),new Character(' ') );
		pageContext.setAttribute("obs", obs);

                String bene  = obj.getCliqu_beneficiarios()!=null ? obj.getCliqu_beneficiarios() : "";
		//obs = obs.replaceAll("\"","'").replaceAll("\'","\\\'").replaceAll("\r\n","\\\\n");
		bene = bene.replace( new Character('\n'),new Character(' ') ).replace( new Character('\r'),new Character(' ') );
		pageContext.setAttribute("bene", bene);
            %>
        ${i>0 ? "," : ""}
		{
            nliqu_identificador: ${liquidacion.nliqu_identificador},
            nexpe_identificador: ${liquidacion.nexpe_identificador},
            ntibe_identificador: ${liquidacion.ntibe_identificador},
            ctibe_descripcion: "${liquidacion.ctibe_descripcion}",
            cliqu_beneficiarios: "${bene}",
            cliqu_dictamen: "${liquidacion.cliqu_dictamen}",
            dliqu_fechainiciopension: "${liquidacion.dliqu_fechainiciopension}",
            nunpa_unidadpago: ${liquidacion.nunpa_unidadpago},
            dliqu_fechabaja: "${liquidacion.dliqu_fechabaja}",
            nmore_identificador: ${liquidacion.nmore_identificador},
            cliqu_cgts: "${liquidacion.cliqu_cgts}",
            cliqu_tiemposervicio: "${liquidacion.cliqu_tiemposervicio}",
            cliqu_completoespecial: "${liquidacion.cliqu_completoespecial}",
            cliqu_pagobenope: "${liquidacion.cliqu_pagobenope}",
            cliqu_mesparcial: "${liquidacion.cliqu_mesparcial}",
            cliqu_observaciones: "${obs}"
		}
        <c:set var="i" value="${i+1}"></c:set>
        </c:forEach>
		]
}
